package com.alpha.processor.creators.base;

import com.squareup.javapoet.TypeSpec;

import javax.lang.model.element.Element;


public abstract class FileCreator {

    public TypeSpec genarateTargetFile(){
        TypeSpec.Builder builder = getClassBuilder(getGenerateFileName());
        buildFile(builder);
        return builder.build();
    }

    protected TypeSpec.Builder getClassBuilder(String className){
        return TypeSpec.classBuilder(className);
    }

    protected abstract void buildFile(TypeSpec.Builder fileBuilder);

    public abstract String getFilePackageName();

    public abstract String getGenerateFileName();

    public abstract String getGenerateFileFullName();

    public abstract Element getClassElement();
}
